package com.brokendust.client.config.hub;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import java.util.HashMap;
import java.util.Map;

public class HubJson {
    private Map<String, String> object_list;

    public HubJson() {
        this.object_list = new HashMap<String, String>();
    }

    public HubJson(Map<String, String> object_list) {
        this.object_list = new HashMap<String, String>();
        this.object_list = object_list;
    }

    public static HubJson readJSON(String string) {
        GsonBuilder builder = new GsonBuilder();
        Gson gson = builder.create();
        return gson.fromJson(string, HubJson.class);
    }

    public void addObject(String type, String data) {
        this.object_list.put(type, data);
    }

    public Map<String, String> getObject_list() {
        return this.object_list;
    }

    public void setObject_list(Map<String, String> object_list) {
        this.object_list = object_list;
    }
}

